{% extends 'base.html' %}

{% block title %}
	博客系统-首页
{% endblock %}

{% block head %}
	<link href="{{ url_for('static',filename='css/index.css') }}">
    <style>
    a{
        text-decoration: none;
        outline: none;
    }
    </style>
{% endblock %}
{% block content %}
    <div>
        {% for blog in blogs %}
            <div class="panel panel-default" style="height: 130px;padding: 0 0 0 0;">
                <div class="panel-body">
                    <div class="row">
                        <div class="col-xs-3 col-md-2">
                            {% if blog.picture %}
                                <img src="{{ url_for('static',filename=blog.picture ) }}"
                                     class="img-responsive" alt="博客封面" style="height: 100px;width: 100px">
                            {% else %}
                                <img src="{{ url_for('static',filename='images/avatar.jpg') }}"
                                     class="img-responsive thumbnail-img" alt="avatar" style="height: 100px;width: 100px">
                            {% endif %}
                        </div>
                        <div class="col-xs-9 col-md-10">
                           <a class="panel-title" href="{{ url_for('blog.detail',blog_id=blog.id) }}">{{ blog.title }}</a>
                            <p class="text-muted">
                                <small>作者：{{ blog.author.username }} | 分类：{{ blog.categorie.name }} | {{ blog.create_time }}</small>
                            </p>

                            <p>{{ blog.content[:100] }}......</p>
                        </div>
                    </div>
                </div>
            </div>
        {% endfor %}

    </div>
{% endblock %}